﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Dingding.Helper
{
    public class JsonHelper
    {
        public static string GetJson(object obj)
        {
            return JsonConvert.SerializeObject(obj);
        }
        public static T DeserializeObject<T>(string json)
        {
            return JsonConvert.DeserializeObject<T>(json);
        }

        public static dynamic ConvertDynamic(object obj)
        {
            return JsonConvert.DeserializeObject<dynamic>(GetJson(obj));
        }
    }
}